Repository navigation
nixos: vendor the oc-password-sync script into the flake (code#3724 reconciliation) - #4170
Merged
Merged
Conversation
The folded module declared units whose ExecStart target (~/.local/bin/oc-password-sync.sh) the flake did not provide: the script — including the corrected code#3724 drift logic — existed only as an unmanaged operator file on the laptop. Vendor the script beside the module (byte-identical to the verified live file, sha256 fc47b0d0…) and install it at the referenced path via home.file. ExecStart and both units are unchanged, so the next activation swaps the operator file for the store copy with zero behavior change.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 49 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
The last loose end of the 2026-11-01 flake fold for oc-password-sync. The fold (PR #3722) moved the units into the flake, but the thing the service actually runs — the script at
~/.local/bin/oc-password-sync.sh— stayed an unmanaged operator file. Worse, the corrected code#3724 logic (drift judged against the running OpenChamber process's/proc/<MainPID>/environ, fallback to the last-synced hash in~/.local/state/openchamber/password-sync.state, restart + verify on drift) existed only in that laptop file. Nothing in version control held it; a rebuilt home would have left the folded unit pointing at a missing file.This PR makes the repo the durable home of that behavior:
nixos/home/oc-password-sync.sh— the script, vendored byte-identical to the verified live file (sha256fc47b0d0ca4766a65a8a9225c865f59a920176a274e259adaa44d2f57d0a5df3on both sides at the time of the change).nixos/home/oc-password-sync.nix— provisions it viahome.fileat the exact pathExecStartreferences, and records the history in the header. ExecStart and both units are unchanged — deliberately not thewriteShellScriptBin+ store-path pattern used by sibling modules, because the fold's discipline was byte-equivalence of the units and~/.local/bin/oc-password-sync.shis also the documented manual-invocation path. At the next activation home-manager renames the operator file to*.backup(backupFileExtension is set) and links the store copy; the bytes are identical, so behavior cannot change.Reconciliation of the record (why #3724 stays closed)
The fold-completion notes (laptop-hygiene Addendum 12) recorded the live
.serviceas "still fails on trigger for the known pre-existing missing drop-in, code#3724". That was a stale reading — the journal tells the real story:openchamber.service.d/external-opencode.conf): 05:07, 05:11, 05:55, 08:12 CST — all before the fix./nix/store: successes at 22:09:28 and 22:16:12.service-prod.jsonfired the.path→ serviceResult=success,ExecMainStatus=0; OpenChamber MainPID unchanged, active, HTTP 200. A dry-run drift test (temp JSON,OC_DRY_RUN=1) printeddrift detected (dry run), exit 0, OpenChamber untouched.So the layer Addendum 8 fixed (the operator script) is the layer the live unit executes, before and after the fold; the #3724 closure was correct. What was actually missing — and what this PR fixes — is only the durability layer: the fixed behavior had no home in the repo.
Effect on live behavior
None on merge or on primary pull: the unit executes an operator path, not a checkout path, and the bytes at that path already equal the vendored copy. The change takes effect at the next NixOS/home-manager activation, when home.file assumes the path. Until then the operator copy at
~/.local/bin/oc-password-sync.shis left exactly as-is — it is identical, not divergent, so there is nothing to reconcile by hand and nothing is deleted.Verification
sha256sum: vendored file == live laptop file (fc47b0d0…).nixfmt --check nixos/home/oc-password-sync.nixclean.home.fileentry in an existing module; it rides the normal merge/switch pipeline.Refs code#3724, code#3720.
Need help on this PR? Tag
@codesmith-botwith what you need.